package com.googlecode.particlesys.templates;

import java.awt.Color;

import com.googlecode.particlesys.objects.AbstractEmitter;
import com.googlecode.particlesys.objects.EParticleShape;
import com.googlecode.particlesys.objects.Particle;

public class Cyclone extends AbstractEmitter {
	
	private double angle = 0;

	public Cyclone(int x, int y){
		super(5, 5, x, y, 25, 0);
	}

	@Override
	public Particle getNextParticle(){
		Particle p = new Particle(Color.GREEN, EParticleShape.SPHERE, width, height);
		p.setX(x);
		p.setY(y);
		p.setSpeed(5);
		p.setAngle(angle -= 10);
		p.setLife(25);
		return p;
	}
}